added parallel code