Neither function returns anything (based on code review and running). Possibly related to #3. Opened new issue as impacts both routines.