Clean Up

Cleaned up some code, and added comments