added code and revised readme