refactored big headspace method