converted Balance.pm into OO code