i have written this program (its not finished, there are more functions to be added) however, I want to know why my withinBudget function is sometimes producing correct res