Added more code to get editing samples to work