Added support to multiple layers of tiles.