add grouping tiles code