implemented pause function, fixed collision bug