Soft errors have been a concern in memory reliability for many years. With decreasing device feature sizes and increasing memories density, a single event upset (SEU) may generate adjacent MBUs. To avoid data errors in memories, Error Correction Codes (ECCs) are used. As multiple cells affected become frequent, the common Single Error Correction (SEC) codes are not enough and more advanced ECCs are needed. In this paper, an optimized Orthogonal Latin Square (OLS) code capable of double adjacent error correction is proposed by optimizing the structure of OLS using the proposed block cyclic shift algorithm. The proposed code has higher correction capability than the original OLS code and lower overheads than the OLS code capable of two errors correction.