initial commit (modified code from the thesis)