Added a rewind function