added implicit euler as described in c)