changes to program7 and added expected output