Refactored "SetOutputPorts" method to fix port alignment issue