Improving the Throughput and Reliability of Wireless Sensor Networks with Application to Wireless Body Area Networks