Modify code for thesis.