added example code and test