refactored eulers