Split into functions, motors renamed., course corrections, minor rewrite