added simple example and minor refactorings for naming and style