moved java code