updated native Java code