edited variable names for readability