better style, clean code, fixed bugs