initial raw code. readme and comments to follow