Code for Z+c analysis