determine direction