Improved returnMode function
Improved probability calculator (this is probably very wrong, I'm so sorry)