#49 some enhancements and bug fixes