change name of script file for clarity
refactored some of sanity_checks() until I got confused and had to stop