added write to coords file