Begin implementing library sort code