updated challenge 2 base code