Fixed matching logic in CubeBoard.java