added listing demonstrating how function work