Code for the Base Station