mmap didn't work right - changed to malloc