bug fixing and improving for issue #10

function in routines.common are certified functionnal