working on nearest stop form part 1 of x