Adjusted code for x64