changed variables and functions