Waiting between frames

Corrected the horrific empty while loop to wait between frames.