removed use of var count in balance

more functional