fixed delta time and removed unnecessary vars