Cleaned up some stuff, wrote comments