added time function but day event is messing things up, it seems to be only analyzing day events