insertAndSplit and constructor

insertandsplit is functional, added constructor