Added documentation and removed IO from minimax functions