Commenting for previous function

Added a lot of commenting describing how the functions work. Still need
to fix the bug where the edge sizes are wrong (set to 0) .