added calculation for mouse location