updated to let PIC keep track of time