New Julia solution, uses inner constructor.