changed from forwards euler method to backwards euler