Refactor to reduce duplication.
Use CamelCase for function names.
Use snake_case for variable names.
Cleanup printing and calculation!