added writercord function