Fixes the ordering of sockets.
Bug fix in calculation.
Bug fix DESC -> ASC
Test if this was a bug.
Maybe the list should not be reversed.
Some more bug fixes.