refactored, readme updated, example added