updated todo. Added comments and also made the getname/numtriangle/nextriangle passed by reference instead of pass by value.