renamed main to a method