fixed mistyped variable names and inputs