Changed main to method.