fixed a wrong implementation, switched to e-f