Added even and odd loop