added implementazion and tests