slimming down the logic for space checking