Ported the system from python to java.