add position tracker
Added insert function for ranges