sort comparable arrays