Implement tile merging