Added pause function.
Added check for win state, exits on win