Mouse calculation fix