Initial code -- memory access problems