Clean code

Cleaned up code to make it more readable, still need comments.