Cleaned up code and updated readme.