wrapAsFunction is done and tested