changed a lot of var and function names