Updated code for Functions Wacky

Included a loop and equation for solving final problem