changed tiles to be 0-indexed