added front variables logic