Added code and documentation. Edited Readme.