adding in logic