sorting tiles; grouping blocks