Code that I am no longer working on, this is for historic purposes.