improved logging and direction testing