added widget code and core logic to the tool