Main function skeleton complete