slightly more sane save directory

Instead of accessing system functions directly (big no no in a project longer than a file with a single function) you should put them in a function that handles all this for you:
- Process the inputs
- Access the functions
- Process the outputs
- Return desired output