Fixed spaces, added comments and renamed variables