solved assignment2 1-6