Preparing input data