repurposing of the script for unity
assorted script changes