converted check tile from do-while to while..