Added gerneal create and update function
Fixed bad return value in maybe create hashtrees
Changed based on @lenary's comments on the PR.