DSA homework 3