util to convert input to arrays