write load and beginning of main