python codes with and without uncertainty now working