Wrote some psuedo code for minmax