applied bug fix for #6, program can handle now networks with single or multiple output branches in the right manner