Clean up of some of the code, worked out some of the basic skeleton structure