added functions to track mouse movement