Fixed sha256 function
small optimisations
Final SHA256 fix