spacesAvailable logic correct