fixed calculation bug and made budget variable