Implemented implicit Euler Method