MD5 calculate algrothm (updated)