Tweaked the am/pm routine to be a bit more efficient.