space calculation