improved mapped memory example