Code for the Master thesis