Basic implementation and tests