Code for COPADS