rewrite lib, updated readme