Implemented pause function using p key