Mouse algorithm framework