step 1 of algorithm