this script contains a bit of everything, printing to screen and writing to JSON