convert ticks to time
cleanup and comments