fixed bug with creating final hash, and added regressions