refactor variable names
improved documentation