Fixed bugs. Working code without alpha beta