Code completed

Now the hardest part.. Debugging -_-