try to make code a bit more modular
prepare for more modular code
also return planets sorted by ships
extend distance to return a near target