Source code for thesis