Add comments and change the order of definitions.