where does the captain of a ship work