Updated with answer to assignment