From profiles to patterns and back again: a branch and bound algorithm for finding near optimal motif profiles