Added shared functions per issue #12