What exactly is the problem with your script? Aside from printing the same balance twice, it should work as coded.