Relevant code to Senior Lab project; Denitza Ivanov & Michael Scibor