Added gesture detection