Added Bruce's code and the question