rework MD5, fixes some issues