Battleship challenge: refactored ship placement method