added README and fixed a bug