@Override
	public boolean execute(MessageContext context) {
		String arguments = getArguments(context);
		if (arguments.equals("")) {
			sendUsageBack(context);
			return false;
		}

		Matcher matcher = dicePattern.matcher(arguments);
		if (!matcher.matches()) {
			sendUsageBack(context);
			return false;
		}

		int diceNumber = Integer.parseInt(matcher.group(1));
		int diceType = Integer.parseInt(matcher.group(2));
		int total = 0;
		if(matcher.groupCount() > 2 && matcher.group(3) != null) {
			total += Integer.parseInt(matcher.group(3));
		}
		int[] results = new int[diceNumber];
		Random random = new Random();
		for (int i = 0; i < diceNumber; ++i) {
			results[i] = random.nextInt(diceType) + 1; 
			total += results[i];
		}
		String response = "Results of " + arguments + ": " + total;
		StringBuilder rolls = new StringBuilder();
		rolls.append(results[0]);
		for(int i = 1; i < results.length; ++i)
			rolls.append(", " + results[i]);
		String details = "Rolls: " + rolls.toString();
		sendMessageBack(context, response);
		sendMessageBack(context, details);
		return true;
	}