added am/pm functionality