assigning inputs and outputs internally

Yes, it can be done.

Depending on your specifics there may be more specialized alternatives out there.