rearranged and added circuits