Old version of layer3.c, just in case