passing functions as arguments instead of using autorun blocks