Added delete method
Fixed appending to file problem