clean up syntax and indentation, use %W syntax for arrays