tests and code for right to left and up directions.