added comments, removed timestruct and moved the ints out of the loop, removed whitespace