Streamlined recv logic
Cleaned up code