shortened variable names and rearranged