Replace example with one provided by stack overflow