modify grid system add if and variables