helper functions for stsim
STSIM - 1
Tested compute helper functions