Made loop which looks for serial response more general.