Added code for prog optimizer but it's not connected to the UI yet, so it probably is horribly buggy