added code for combinations