Add apply function.