updated with example code