fixing the writing of a class