complete implementation, before tests