fixed panning
simplified code
fixed random planet selection glitch
improved efficiency of algorithms slightly