updated code so that in admot::both, the 2nd directon is optional