added crystal loading from inputfile