Debugged the code part 2