Preparing a sample