7/7 commit 2

Background functions mostly for generating data necessary for later
simulations.