changed the order of printing