Guide for creating own function with callback