part 1 working correctly and outputing correctly