Assignment 2 enhanced