Beginning rewrite for x86_64