fixing small errors, added date/time functions