Added function apply.