Removed extraneous code, added comments, fixed broken syntax