Using array with possible directions.