added stack_recv function+changes