Although my compiler isn't complaining when I remove the cmath and algorithm #includes, I am suspicious...added them back