changed logic back to MPIsend and receive