working timelog function