Code for thesis