modified tslib.sub