added anonymous function support