Simplify code, add interactive example