This function implementation has been moved to the related example. Current implementation can be probably customized depending on user needs.