Improved shake detection