fixed some formatting issues and type annotations