Solution to penultimate question