new julia implementation
some minor fixes