added deltatime and iteration control