all unnecessary printfs deleted