code formatted using eclipse