Adapted hat to fit new hmlib