stratified function and documentation added