remove printing and writing unnecessarily