fix indentation, add type annotations, fix extra bracket from refactor