parallel and sequential codes are updated. Now both work properly.