added the tile generator method