added revers output option