sort both ways, thanks to euqip https://github.com/emoncms/emoncms/issues/245