cleaned example code