updating example with main class and method