Broker code rearranged. Prints added