Fixed synchronization code for (R)eceiving option. Going to separate the
S and R code into separate threads for better readability.