Semi-working code with server connect, need to make it only calculate
once and also not make bad moves maybe