mouse calculation