Added gesture capture code