Some additonaal checks inserted in function and simplication of code resumed up to 'ds.C'.