calling functions with .apply