OLL and PLL with pattern table