proper Java implemented