user defined functions actually work now