final version for assignment 1.