vars added, rearranged