Implementing euler method to work. There are some problems.