Need Help with a Tic Tac Toe MiniMax Algorithm

I figured it out, I have confirmed that my board without the first move being random makes the same exact moves in response to me as the one I designed the algorithm around. The Solution would be too complex to explain here, simply put I was just doing things wrong.