Refactor out normalizeTime(), fix logic bug

Fix for issue #1
Merge pull request #3 from rtucker/issue_1

Refactor out normalizeTime(), fix logic bug