Temporary migration to Python because of problems with the implementation :)