Added functions to select and copy data