Added snippet code and updated readme.md