insert functionality(minor fixes to classes)