finished parallel code and debugging