make this a full function, and document it.