Uncertainty

Separated the functions and the actual code I hope this cleans things up a bit.