add info about spec
improve insertion, code how to free memory