added some loop test code