Removes trailing spaces, fixes formatting