Code for the HUB