added optional einhorn support