improved documentation
fixed variable name