Edited code slightly, still unfinished.

I'll keep working tomorrow, for now I'm gonna go to sleep.