Slightly broken, but almost functional load corpus function.