commit to save state

All code I believe is done, need to review and test the code.