all code before choosing final amplitudes