Working on integrating Greg's junciton script

Fixing tests for the new script