outputs to the correct directory