script for grandCanonical