added x64 optimizations