added some insert functions
Merged with master