Completed code to copy board