somewhat working version of insert/get
fixed some issues