Pause function but the thing is a mess