Assignment 2 Advanced Solution