Cleaned up Code

Cleaned up some unneeded code and added comments for easier
understanding