mousetracking in its own function