Final prob 5 & 6 code