added TODO comments
moved max_degree() definition