Refactor writes, add another special case
Merge pull request #4 from PreetamJinka/issues/3-insert-from-end

Refactor writes, add another special case