Added a crappy Java-port for comparision