Needs doc strings throughout (or suppress I guess).