Rewrite function to calculate available amount to budget