My attempt for assignment 2