added more comments and changed final output text