Fixed NPE
Better toString() method
Output sorted list