resgen (issue #4)