Added email bot and revised some code