Friends complete, added sort logic