Final version for HW3