optimizations and draft of 5 in a row checking