Main function at the beginning of the file