code used for my masters thesis