modified ex 33 to take 2 variables