fix bug in andrews number calculation