Commented all code and cleaned up unneeded variables