implemented time function