Initial adaptation of Dan's script for bulk processing tiles