copie from debauer/scripts