added code-formatting script; applied it to code base