fixed bug with helper f(n) templating