cleaned up the newTile function