instead of using subprocess to call python commands, now importing and using the functions directly in the main script