New coding for assignment 2