code & calculation
code cleanup