added log function, fixed formula data_type