moved the actual routine into a seperate source from the main. This allows the routine to be used in other applications.
This commit was generated by cvs2svn to compensate for changes in r34, which included commits to RCS files with non-trunk default branches.