added a row variable in space elements, so no need for both a space and space2 element directive
div for green squares has ternary operator for spaceNumber