changed some variable names to make things more readable