Found another optimization (checkElements)