improved minimax for endgame
added time function. minmax stops when calculation time is >55s