main processing skeleton