renamed attr to arr, added doc for sort method