corrected output... nearly done