Taking corrections and implementations from Juan
Correcting minmax function
Updating main file and README