BIG TROUBLE: custom functions, unpredictable behaviour