Cleaned up the code for gesture completions