renamed variables to be correct