changed declarations of var, param and const