works with buffer of [a]