Added horizontal logic