added correct sentinel value to main