Added direction handling

Signed-off-by: bcnjr5 <bcnjr5@gmail.com>