animate function

work in progress, only works for functions at this point