updated example to look for memory leaks