First dump of code - lots of documentation cleanup needed