wrote the constant folding part