refactored function names and updated readme with an example.