tidied up the code for both scripts
Merge branch 'cram_tidying' into develop