write methods for ship class