Added README and fixed some bugs