Work on unpacking input function and transform into array structure