Updated README.md
Added flag control and fixed threading issues