Added a huge amount of code from two days worth of work.