full implementation and doc