Fixing some erros in the budget funtion