Implemented the third part of exercise 3.4 (memory access)