fix indentation bug and various of tweaks