added array sort, binary search and triangle counting