fixed formatting and now outputs stdout and stderr