naive minimax implementaion