added null modeling functions for S. Needs work