functions Ex 1 & 2