modified the read method and added the write method in csv