Commit of min max code before I mess it up even more