mouse gesture project with new algorithm