Issue #2: Flags, code cleanup and test case added
bump version (0.4.0)