added var budget and made it an argument