changed some variable names to make them more clear