Updated the code and completed assignment