updated readme and fixed a bug in library