Added an intermediate empty object between square array and piece, for future inclusion of squares into sets
generalised check of coordinates outside board