Function to get ship coordinates, bug fixes