wrote scripts for the cases in problem 7