Moved ratio out of if.
Implemented Reset.