big changes with some indentation fixes