Improved gesture recognition