updated removeNode method inorder to handle special cases when we have 3
or 2 or 1 nodes in the System