Added code and updated README.