Bug fixing and updated Output