First commit of pre-existing source code that I wrote earlier for another project. Needs encapsulation next.