fixed some bugs in SSRT calculation