Initial attempt at solution