array to list conversion and vice versa