Added apply and queue functions.