Cleaned up my code and did some commenting and such