added direction option.