Fixed problem 1 and 4 from DK (no change needed for 4)