TO DO: improve memory management
error if input is out of order when building sst
1.0.3