changed 3 equations for proper log