adding tests, no memleaks