added code for assignment 7 in cs758