added simplfication of log function