change matchref to iamatch and cleanup whitespace