write functinos of cliboard and reorganize