Adding code for questions 5 & 6