changed get_indent() to be imperative, because code should be idiomatic to the language, regardless how poor