Java version

Used the Python and C++ as basis. Hope this initial implementation is correct :o)