Run function for a program with a system