extract_params function

Extract parameters from input and add them to params