fixed compilation
renamed log to log_f and added log function