lots of little stuff
function pcd +robustness
added function management