improved space allocation