VALENCE: a program for calculating bond valences