Updated logic.
Updated README.