maybe make the length a local variable called distance to make it easier to read the condition