turned indent into a function, reorganized file