change columns name; improved algorithm permission