started a replaceTiles function