updated example code and readme