implemented insertion and tests