Changes list to proper format