updated README.md and added lib code