minimal, but complete implementation