added write from class