toFunction added