Working demonstration for rectangle click function