completed ideal implementation