made changes to code so that any variables not used after initialization are deleted to free up ram. Also, the code runs to completion with swap memory