reindented
refactored output format
added get_output() method
removed the dynamic final_ prefix
updated