readded knubot functionality, fixed various possible bugs