Initial work now working
Code cleanup and docs