second based implementation