added samples and utility refactored a little