converted scripts to lubridate package for manipulating date and time data