fixed typos and refactored methods
added one more example
added example
fixed code