this fixes #6 and #9
reset connections counter to previous
added missing array parts
updated null handling
fixes #8 winning logic not resetting connection counter