Cleaned up Code

Deleted excess code, moved stuff into methods