Added docs to readme, refracted code for usability and readability.