match code, pointed out by Sergio Gelato <Sergio.Gelato@astro.su.se>