finished scanForPlanes function