java for MarsRover problem