Rearranged and added register comparision