rearranged some variables