working example of apply