better indent script to fix closing square brackets