Implemented the haskell minmax
more testing / fixing stuff