Remove old commented code
Fixed memory access