finished cs758 asst-12