Updated with assignment code and relevant comments