printstdio fixed to use linked list sort