Added pins to receive, wait function