imporve Java code by adding a Sender