Updated parallel code