Sample preparation method and apparatus