add more comments and example code