I'm gonna let you figure it out yourself!
Loads of credit to FaceO's, again for the giant code. Mostly everything else is mine.