Edit code for ports