added debugging print loop