fixed all 9 functions!

Only the reverse function left!
have a doubt which has been saved to spider1.cpp
(I had to make a condition for 2 nodes case just to avoid that problem)
:D !?!?!?