Changed insertExp function

Included function by Scott Klarr