added code for doing a toy linearity study.