changed code to make it more consistent with cook model