Changed make_partices so it uses intern variables