split optimization into two files, one for programs, one for implementing programs