added support for insertions at the end of the sequence
changes for banyan