rearranging in an object oriented way
finished and wrote test, still needs correction for the bias when the sigma is low. Will do that soon.