Added basic record-keeping written to csv, replaces printing to console.