Overloaded << operator.
Implemented a working insert_at_rank function.