function eval works correctly, not sure on moments yet