added a maximum delta time to prevent really bad simulation on slow computers