cleaned up time units code slightly