added support for anonymous classes, fixes #1