tidied port.h