Automate

@ctb please wait. Not done yet.