Code for bachelor thesis.