Change the range of how many processes to ad into memory. Working on breaking out of the nested for loops if there is no memory for the remaining processes.