Main method