printf updated accordingly to requirments