implemented Euler Method