basic implementation and tests