Calculate balance