Add generic insert
Main functions are working. Need some refactoring though