a dirty implementation with association algorithm