refactoring
adding mediandepth by sample