added toHash method