/ updated so that it can deal with multiple matching in extensions, with