Added ex 19 and a extended version with some if statements