fixed formatting and calculations for test case 1