The solution is already given in reply #3 from Lisandro