Updated with assignment solution.