Function to parse arguments to dictionary