switch to pkg/flag
updated inline docs