remove trailing whitespace
fix sort_by example