Fixed issue #30

Fixed issue #30 and removed some obsolete code that I added and didn't remove for the edit categories issue.