Added method that tracks mouse position at periodic intervals