added recieve code back in
merge attempt 1 with auto