added code from ham blaster