wrote code for multiple outs