fixed test and added method in class csvwriter