added tons of comments to document tile.lua