fixing errors and polishing up