Implemented factorial and date_trunc