Add Problem4 code