Calculating of the next move (Doesn't work yet).