Added bot code.

Remaining is diff function and then main routine for the bot