a should be vector