initial commit
further reduction in extraneous code
further tidying