converted references to pointers
added a small example