restored case insensitivity, corrected some naming and comments