full implementation with initial testing