Automation script added. Bugs corrected.