adapted to Julia