cleanup, added comments
forgot to remove print statement used for debugging