Now sorting on by ts or time
Removed unused code