balance.c

fixed tip detection