Built recording function out. Needs to be automated, and call python script on exit