using pattern recognition to call function