corrected pattern for function calls & some debugging