Calculates beta and sends it to p. Need to send it to R nodes. Care of everything messing up