Minor changes in comments and sorting order.
Added initial multithreading support.