added example code and output