ENH: changes to code after comments, take out the filename, used enum type