remove extra lines #432

removed extra lines and move time.sleep(1) to function