adding copy_rectangle routine as helper function in testing