public void init(List<CubePiece> cubePieceList)
    {
        if(cubePieceList.size() != 6)
            throw new IllegalArgumentException("A cube has to have 6 faces");

        // Init map for each cube piece
        // In other words each piece knows which other piece they fit into
        cubePieces = cubePieceList.toArray(new CubePiece[6]);

        for(CubePiece cubePiece : cubePieces)
        {
            for(CubePiece cubePieceOpp : cubePieces)
            {
                // If they are the same cubes pass
                if(cubePiece.equals(cubePieceOpp))
                    continue;

                for(Direction direction1 : Direction.values())
                {
                    for(Direction direction2 : Direction.values())
                    {
                        CubePieceConnection cubePieceConnection = new CubePieceConnection(cubePieceOpp.getCubeNo(), direction1, direction2);
                        boolean layersMatch = layersMatch(cubePiece.getOuterLayerMap().get(direction1), cubePieceOpp.getOuterLayerMap().get(direction2));
                        /* TODO : CLEAR ?
                        cubePiece.getMatchMap().put(cubePieceConnection, layersMatch);
                        */

                        if(layersMatch)
                        {
                            // Increment total matches later on to decide which cube piece to use as a pivot
                            cubePiece.incrementTotalMatches();

                            // Record all matches
                            cubePiece.getDirectionalMatchMap().get(direction1).add(cubePieceConnection);
                        }
                    }
                }
            }
        }
    }