added validation and docs