Added click support
Removed debug code, replaced snprintf with sprintf