Function to save data to file and an example output

Coded by Nick + Matteo