Errors and formatting fixed