added usage and refactored code. first minimal running
merge