working on finding a good cost for grouping tiles