Copied memory optimization from other branch instead of whole branch

Signed-off-by: Michel <info@1st-setup.nl>