cpu algorithm implemented