minor changes, some refactoring, code ready for presentation