now functional, add docs