cleaned up the code, added comments, closed all brakets