Preliminary work for problem 11