Version that work with visualisation in java