Added to_naf function to make double-add-subtract function more natural to use.