Code works, just make sure you know how much it costs after the 1st free year, or transfer it to Namesilo for free WHOIS privacy and email forwarding.
normal price for xyz at AlpNames is $9.50, they provide 2 free mailboxes for each domain and their DNS is pretty fast, faster than namecheap's (tried)