Change algorithm to detect mouse position and use it as range