bringing in Dan's updates for Burung

these still need to get smartly merged with the main script