finding max value of possible moves