added scoring logic for a 5x5 board