scripts to build records. Ugly but relatively quick. Work in progress.