copied version for SCGSR application