added rk4 algorithm