correction for case where b is longer than a