grouped duplicated code into single method, improved oo of the controller by putting codes in main into a method, declared a static array variable to store ship sizes