Added some initial code, obviously there is much more work to be done.