some bugfix (runge kutta method) and refactoring.