Sort less naively

Addresses #40