Connect 4 algorithm inplemented in Java