parallel version added, preliminary notes in comments