edited around declareVariable()