Added loop to ensure good input.