Code for my bachelor work.