solve: support multiple outputs

Fixes #172.