Dynamic count of inputs and outputs (not finished)