added the onevent and the trigger method from the idea, trying to pass the test now
updated version