added examples and changed the code to match the description from the README