Code used in the chapter Measuring Natural Selection