Fixed some stuff
Cleaned up some code