moved output into a function and created bools for argument list