develop flexible attention

develop flexible attention