Updated answer to homework question