Parallel version now should work correctly.
Some comments added, code "refactored".