add composition class
add more docs and tests