rewrite send recv and help functions