based on psrivas2 commit to RSBench