Initial addition of my original code base from my M.Sc. thesis.