More tweaks to loadProgramIntoMemory() function. Still doesn't work as intended.