changed some variable names for better abstraction